package com.qingzhuge.sys.service;

import com.qingzhuge.common.IBaseEnum;
import com.qingzhuge.common.enums.*;
import com.qingzhuge.service.IBasePkLongService;
import com.qingzhuge.sys.entity.SysDict;

import java.util.List;
import java.util.Map;

/**
 * @author : zero.xiao
 * @description : 数据字典
 * @date :2018/6/8 0008 下午 15:04
 * @modified :
 * @since : 1.0.0
 */
public interface ISysDictService extends IBasePkLongService<SysDict> {

    enum Type {
        /**菜单权限*/
        CRUD("菜单权限", EResourceType.values()),
        /**性别*/
        SEX("性别", ESexType.values()),
        /**角色类型*/
        ROLE("角色类型", ERoleType.values()),
        /**菜单类型*/
        MENU("菜单类型", EResourceType.values()),
        /**会员登录方式*/
        MEMBER_LOGIN_TYPE("会员登录方式", EMemberLoginType.values())
        ;

        private String value;
        private IBaseEnum<String>[] type;

        Type(String value, IBaseEnum<String>[] type) {
            this.value = value;
            this.type = type;
        }

        public String getValue() {
            return value;
        }

        public IBaseEnum<String>[] getType() {
            return type;
        }
    }

    Map<String, Map<String, String>> getAllDict();

    Map<String, String> queryDictByType(String key);

    List<SysDict> queryByType(String type);
    List<SysDict> queryByTypeAndCode(String type, String code);
}

